<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>并发</title>
  </head>
  <body></body>
</html>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.27.2/axios.min.js"></script>
<script src="./index.js"></script>
<script>
  // http
  const apis = Array.from(
    { length: 10 },
    (_, i) => `https://jsonplaceholder.typicode.com/todos/${i + 1}`
  );
  // 并发
  getConcurApi(apis, 2).then((val) => {
    console.log("所有请求返回结果 ", val);
  });
</script>
